home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / xeno / megacd.lha / megacd / MegaCD.rexx < prev    next >
OS/2 REXX Batch file  |  1995-10-01  |  23KB  |  800 lines

  1. /*************************************************/
  2. /*                                               */
  3. /*  MegaCDDOOR.rexx v1.3 ⌐ David Huckett..       */
  4. /*         Xenolink  CD-Rom Door.                */
  5. /*   By David Huckett  22-Sep-95 3:640/800 Fido  */
  6. /*************************************************/
  7.  
  8. /* NOTES
  9.  * 31-July-95 Added bit to allow just to show online CDs only..
  10.  * 12-Aug-95  Removed Listcreator function from within door
  11.  * 12-Sep-95  added option to allow users with no credit to
  12.  *            to be able to have a look around..
  13.  *            Suggested by Peter Chalmers
  14.  *            Added a new file called entry.txt, if found by MegaCd
  15.  *            during startup, it will display the file to the user..
  16.  *
  17.  * 22-Sep-95  Search function working OK now, so I will release for users
  18.  *            to test out..
  19.  *            OFFLINE Requests now implemented and working.. Use the function
  20.  *            and send reports in to me on any ideas on the function...
  21.  *            This is a grey area as far as I have not seen it in use on any
  22.  *            other system, but so far here it works fine..
  23. */
  24.  
  25.  
  26. /**  GLOBALS TO CONFIGURE TO YOUR SYSTEM REQUIREMENTS **/
  27.  
  28. ENFORCERATIOS  = 'N' 
  29. MAXMARKED      = '10'
  30. PATH           = 'Doors:MegaCD/'
  31. CDCFG          =  PATH'CD.cfg'
  32. LINESPERPAGE   = '24'        /** Watch this one as it may stuff up display **/
  33. BYTECHECK      = 'Y'         /** Read Docs and History for a description of this **/
  34.  
  35. ONLINEONLY = 'n'  /* new for two reasons.. 1 for those who only want to */
  36.                   /* display online CDs' 2 Cause I am working over a network */
  37.                   /* now and I had problems with having CDs' in drives on the */
  38.                   /* Network and being able to lock on them wherever they are */
  39.                   /* Loaded */
  40.     /* IF YOU DO NOT run over a network       or want to display all */
  41.     /* configured CD's on or offline, then make ONLINEONLY = 'N'..   */
  42.     /* But remember to remove the second NET: entry for any CDs' in  */
  43.     /* the main CD.cfg file..  Make new .cfg files for each CD over net  */
  44.  
  45.  
  46. /**************** NO FURTHER USER DEFINES BELOW ****************/
  47.  
  48. options results
  49. VERS = 'MegaCDDoor v1.3'
  50. SysopLog 'Entered Door: MegaCD'
  51. PR = 'PRINT'
  52. minbyte = 200000            /** Minumum amount of memory that needs **/
  53.                             /** to be free at all times during use  **/
  54. if storage() < minbyte then do
  55.    pr 'Not enough memory to run MegaCD safely!'
  56.    GetChar
  57.    signal QUIT
  58. end
  59.  
  60. arg Node tmrem baud cps
  61. host = 'XenolinkRexxPort'Node
  62. address value host
  63. signal on error
  64. signal on syntax
  65. signal on ioerr
  66.  
  67.  if ~show('L','rexxsupport.library') then do
  68.   if ~addlib('rexxsupport.library',0,-30,0) then do
  69.     PR 'Support library not available.'
  70.      call error
  71.     signal Quit
  72.    end
  73. end
  74.  
  75.     if exists('T:MRXDL'node'.sfl') then do
  76.         Address Command 'Delete T:MRXDL'node'.sfl QUIET'
  77. END
  78. getuservar name ; name = result
  79. getuservar privilege ; access = result
  80. getuservar maxbytesperday ; mbytday = result 
  81. getuservar bytesdownloadedtoday ; bytdowntoday = result
  82. getuservar fileratio ; fileratio = result
  83. getuservar uploads   ; uploads   = result
  84. getuservar downloads ; downloads = result
  85. getuservar byteratio ; byteratio = result
  86. getuservar uploadbytes ;   uploadbytes  = result
  87. getuservar downloadbytes ; downloadbytes = result
  88. getuservar filesdownloadedtoday ; filesdownloadedtoday = result
  89. fullname = SPACE(name,1,_)
  90.  
  91. BytesAllowed = Mbytday - Bytdowntoday
  92. Numselect = '0'
  93. Numremain = '20'
  94. btselect  = '0'
  95.  
  96. SETNODESTATUS "MegaCD."
  97.  
  98. /** For new users who havent uploaded or downloaded yet **/
  99. If Downloads = 0 & Uploads = 0 Then do
  100. Uploads = 1
  101. uploadbytes = 500000
  102. end
  103.  
  104.     If FileRatio = 0 Then do
  105.         ActFileRatio = 'Unlim'
  106.     end
  107.     else ActfileRatio = FileRatio
  108.  
  109.     If ByteRatio = 0 Then do
  110.         ActByteRatio = 'Unlim'
  111.     End
  112.     Else ActByteRatio = ByteRatio
  113.  
  114. If EnforceRatios = 'Y' Then do
  115.    If FileRatio ~= 0 Then do
  116.       NumRemain = (Uploads * FileRatio) - Downloads
  117.         If Numremain < 1 Then NumRemain = 0
  118.    End
  119.  
  120.    IF ByteRatio ~= 0 Then do 
  121.       BytesAllowednow = (UploadBytes * ByteRatio) - DownloadBytes
  122.       If BytesAllowednow < 1 Then BytesAllowednow = 0
  123.       If bytesAllowednow < BytesAllowed Then BytesAllowed = BytesAllowednow
  124.    End
  125.    If NumRemain <1 | BytesAllowed <1 Then Call Ratio
  126. End
  127. IF MaxMarked > Numremain Then MaxMarked = NumRemain
  128.  
  129. GETUSERVAR MENUSET 
  130. gfx=result         
  131. if gfx >='1' then do
  132.     WHI='';RED='';GRN='';BGRN='';YEL=''
  133.         BYEL='';BLU='';MAJ='';CYA='';BCYA=''
  134.     OFF=''
  135. END
  136.     ELSE DO
  137.     WHI='';RED='';GRN='';BGRN='';YEL='';BYEL='';BLU='';MAJ='';CYA=''
  138.     OFF='';BCYA=''
  139. END
  140.  
  141. p='###PANIC';cmd = '';FILE = ''
  142.  
  143. CALL PRAGMA('W','N')  /* Disk Requesters OFF */
  144. tmrem = tmrem*60;CALL TIME('R')
  145.  
  146.     if exists(PATH'Entry.txt') then do
  147.         CLS
  148.         DISPLAYFILE PATH'Entry.txt'
  149. end
  150.  
  151.  
  152. START:
  153. CLS
  154. pr BLU'          ┌───────────────────────────────────────────────────┐'
  155. pr BLU'          │'BGRN'                MegaCD  CD-Rom Door'OFF||BLU'                │'
  156. pr BLU'          │                                                   │'
  157. pr BLU'          │'BCYA'    for Xenolink BBS, by David Huckett (c)1995'OFF||BLU'     │'
  158. pr BLU'          └───────────────────────────────────────────────────┘'
  159. pr
  160.  
  161.     if ~exists(CDcfg) then do
  162.     PR ' You do not have a config file!'
  163.     call ERROR
  164. end
  165.     else do
  166.     Call open(cfg,CDcfg,'R')
  167.         numcd=readln(cfg)
  168.         do i=1 to numcd
  169.     lock.i=readln(cfg)
  170.     title.i=readln(cfg)
  171.         name.i = title.i
  172.     config.i=readln(cfg)
  173.     desc.i=readln(cfg)
  174.     noacclevel.i=readln(cfg)
  175.     noviewlev.i=readln(cfg)
  176.  
  177. if index(noacclevel.i,access) ~=0 then existnoacc.i = 'No Access'
  178. existnoview = index(noviewlev.i,access)  /* See if you have given access to their level */
  179. if existnoview ~= 0 then do  /* Check to see if the user has view access */
  180. title.i = 'No View'          /* eg GIF CD's, if not then flag this one out */ 
  181. iterate i
  182. end
  183.  
  184. if  ~Exists(lock.i) then do
  185.     if onlineonly = 'Y' then iterate i
  186. pr YEL||left(i'.',4)CYA||left(title.i,15)RED||left('OFFLINE',8)OFF||left(desc.i,45)
  187. title.i='Not Online'        /* If the system can't get a lock on the volume */
  188. iterate i                   /* then flag it offline */
  189. end
  190. pr YEL||left(i'.',4)CYA||left(title.i,15)BGRN||left('Online',8)OFF||left(desc.i,45)
  191.    end
  192.         call close(cfg)
  193. end
  194.  
  195.  
  196. MAIN:
  197.  
  198. Call seiko
  199.  
  200. pstring = WHI'['GRN||numselect||WHI']'showtime()||WHI' ('YEL'Q'WHI'-'YEL'D'WHI'-'YEL'K'WHI'-'YEL'?'WHI'-'YEL'F'WHI'-'YEL'R'WHI'-'YEL'Select #'WHI') 'OFF'>'
  201. pr
  202. prompt 20 normal pstring
  203. cmd=strip(upper(result))
  204. Search = 'N'
  205. Request = 'N'
  206. if cmd=' ' then signal main
  207. if cmd='F' then do                  /*Find/search.....*/
  208. pr
  209. prompt 4 normal YEL'Enter Online CD to search. '
  210. cmd=strip(upper(result))
  211. Search = 'Y'
  212. end
  213.  
  214. if cmd='R' then do                 /*Offline Request...*/
  215. pr
  216. prompt 4 normal YEL'Enter OFFLINE CD for request..'
  217. cmd= strip(upper(result))
  218. if cmd = '' then signal start
  219. Request = 'Y'
  220. end
  221.  
  222. if value(cmd)<=numcd then do
  223.     if title.cmd = 'No View' then do
  224.         pr
  225.         pr RED'       Sorry you cannot view that volume..'OFF
  226.         call delay 100
  227.         signal start
  228.     end
  229.     if existnoacc.cmd = 'No Access' then do
  230.         pr
  231.         pr RED'       Sorry you do not have access to that volume. 'OFF'('GRN'Contibuting Members only'OFF')..'
  232.         call delay 100
  233.         signal start
  234.     end
  235.  
  236.     if title.cmd = 'Not Online' then do
  237.             if Request = 'Y' then call Requested(SPACE(name.cmd,1,'_'),config.cmd)
  238.             pr
  239.             pr RED'       Sorry that volume is not currently loaded..'OFF
  240.             pr
  241.             pr CYA'  You may wish to use the offline request utility by'OFF
  242.             pr CYA' hitting R at the main prompt..'OFF 
  243.             call delay 150
  244.             signal start
  245.             end
  246.         else do
  247.                 if search = 'Y' then call SearchCD(SPACE(Title.cmd,1,'_'),config.cmd)
  248.         else call Selected(cmd)
  249.     end
  250. end
  251. if cmd="###PANIC" then call Quit
  252. if cmd='D' then signal Download
  253. if cmd='K' then do
  254.         if exists('T:MRXDL'node'.sfl') then do
  255.             Address Command 'Delete T:MRXDL'node'.sfl QUIET'
  256.             pr
  257.             pr GRN'Marked files now deleted....'OFF
  258.             numselect = 0
  259.             signal main
  260.             end
  261.         else do
  262.             pr
  263.             pr GRN' You have not got any files marked yet!'OFF
  264.             signal main
  265.             end
  266.     end
  267. if cmd='HELP' | cmd='?' then signal Help1
  268. if left(cmd,1)='Q' then signal quit
  269.  
  270. pr 'Unkown Command 'cmd
  271. signal main
  272.  
  273.  
  274. SELECTED:
  275. PARSE ARG cmd
  276. CLS
  277. pr
  278. pr BGRN||Center('Directories available on 'title.cmd' CD-Rom', 80)||OFF
  279. pr
  280.  
  281. SETNODESTATUS "Listing files on "title.cmd
  282.  
  283. if ~exists(config.cmd) then do
  284. pr ' config file: 'config.cmd 'not found. Please notify sysop.'
  285. call delay 100
  286. signal start
  287. end
  288.  
  289. call open(cdcfg,config.cmd, 'R')
  290. cdpath      = readln(cdcfg)
  291. indexpath   = readln(cdcfg)
  292. displayfile = readln(cdcfg)
  293. skipstart   = readln(cdcfg)
  294. tot = 0
  295. twin = 0
  296. do j = 1 while ~EOF(cdcfg)
  297. dirs.j    = readln(cdcfg)
  298. if dirs.j = '' then iterate j
  299. twin = twin+1
  300. tot = tot+1
  301. tnum = Left(j'.',4)
  302.     IF twin=1 then msg YEL||tnum||CYA||left(subword(dirs.j,2), 30)||OFF
  303.     IF twin=2 Then do
  304.         pr YEL||tnum||CYA||left(subword(dirs.j,2), 30)||OFF
  305.         twin = 0
  306. end
  307.  
  308.         IF (j/2+4)//linesperpage=0 THEN  /**added 3-6-95 for better display of dirs ***/
  309.         DO
  310.     pr
  311.     Prompt 3 Normal WHI'More? 'GRN'Y'WHI'/'YEL'n'OFF' >'
  312.     wnow = strip(upper(Result))
  313.     if wnow = 'N' then do
  314.     call close(cdcfg)
  315.     signal Seldir
  316.     end 
  317.         END
  318. end
  319. call close(cdcfg)
  320. Signal Seldir
  321.  
  322.  
  323. SELDIR:
  324. call seiko
  325. pr
  326. pstring = WHI'['GRN||numselect||WHI']'showtime()||WHI' ('YEL'D'WHI'-'YEL'A'WHI'-'YEL'K'WHI'-'YEL'C'WHI'-'YEL'Q'WHI'-'YEL'?'WHI'-'YEL'Select #'WHI') 'OFF'>'
  327. PROMPT 5 NORMAL pstring
  328. answer = strip(Upper(result))
  329. if answer = '' | if answer = 'A' then signal selected(cmd)
  330. if answer = 'D' then signal Download
  331. if left(answer,1) = 'Q' then Signal Quit
  332. if answer = 'C' then signal start
  333. if value(answer) <= tot then do;File = CDPATH||Word(dirs.answer,1)||displayfile;Lists = INDEXPATH||Word(dirs.answer,1)||displayfile;pr;pr MAJ'Loading filelist...'OFF;call printindex(File,Lists);end
  334. if answer = '?' | answer = 'HELP' then signal Help2
  335. if value(answer) > tot then do;pr;pr RED'No such number listed! Try again..'OFF;signal Seldir;End
  336. if answer='K' then do
  337.         if exists('T:MRXDL'node'.sfl') then do
  338.             Address Command 'Delete T:MRXDL'node'.sfl QUIET'
  339.             pr
  340.             pr GRN'Marked files now deleted....'OFF
  341.             numselect = 0
  342.             signal Seldir
  343.             end
  344.         else do
  345.             pr
  346.             pr GRN' You have not got any files marked yet!'OFF
  347.             signal Seldir
  348.             end
  349.         end
  350. pr 'Unkown Command 'answer
  351. signal start
  352.  
  353.  
  354. SEARCHCD:
  355. PARSE ARG CDtitle,configCD
  356. if exists(PATH'Search.rexx') then address command 'rx 'PATH'Search.rexx 'Node CDtitle ConfigCD
  357. else do
  358.     pr 'Cant find Search.rexx in MegaCD directory'
  359.         pr 'Or the sysop has not set up the search function.'
  360.     call delay 100
  361.     end            
  362.         signal start
  363.  
  364. REQUESTED:
  365. PARSE ARG CDtitle,configCD
  366. if exists(PATH'MegaReq.rexx') then address command 'rx 'PATH'MegaReq.rexx 'Node CDtitle ConfigCD
  367.  
  368. else do
  369.     pr 'Cant find MegaReq.rexx in MegaCD directory'
  370.         pr 'Or the sysop has not set up the Offline Request function.'
  371.     call delay 100
  372.     end            
  373.         signal start
  374.  
  375. PRINTINDEX:
  376. PARSE ARG FILE,LISTS
  377. If ~Exists(LISTS) then do
  378.     PR ' Index file not found.. Notify Sysop.'
  379.     Call delay 100 
  380.     signal start
  381. end
  382.     else do
  383. Call Open(disp,LISTS, 'R')
  384. f = 1
  385. do h = 1 to skipstart
  386. junk.h = readln(disp)
  387. end
  388. CLS
  389. do k =1 While ~EOF(disp)
  390. fl.k = Readln(disp)
  391. if word(fl.k,1) == D2C('26') then Iterate k
  392. if word(fl.k,1) == '|'then do
  393.     if k < 1 then Iterate k
  394.     else do
  395.     pr left(Fl.k,73)
  396.     k = K-1
  397.     f = f+1      /**added 3-6-95 for better display of files ***/
  398.       IF f//linesperpage=0 THEN DO
  399. Call markprompt(FILE)
  400.         END
  401.     iterate k
  402.     end
  403. end
  404. else do
  405. if substr(fl.k,1,1) == ' ' then do
  406.     if k < 1 then Iterate k
  407.     else do
  408.     pr left('',15)left(Fl.k,71)
  409.     k = K-1
  410.     f = f+1     /**added 3-6-95 for better display of files ***/
  411.       IF f//linesperpage=0 THEN
  412.         DO
  413. Call markprompt(FILE)
  414.         END
  415.     iterate k
  416.     end
  417. end
  418. end
  419. if substr(fl.k,1) ~= ' ' then do
  420. fnum = left(k'.',4)
  421. pr YEL||fnum||CYA||Left(Word(Fl.k,1),24)||OFF||subword(left(Fl.k,71),2) /* 73*/
  422. f = f + 1          /**added 3-6-95 for better display of files ***/
  423.       IF f//linesperpage=0 THEN
  424.         DO
  425. Call MarkPrompt(FILE)
  426.         END
  427. end
  428. end
  429. call close(disp)
  430. pr 'Directory end.'
  431. call markprompt(FILE)
  432. Call Selected(cmd)
  433.  
  434.  
  435.  
  436. MARKPROMPT:
  437. PARSE ARG FILE
  438. call seiko
  439. pstring = WHI'['GRN||numselect||WHI']'showtime()||WHI' ('YEL'D'WHI'-'YEL'K'WHI'-'YEL'M'WHI'-'YEL'C'WHI'-'YEL'S'WHI'-'YEL'Q'WHI'-'YEL'?'WHI'-'YEL'A'WHI'-'YEL'[return]'WHI') 'OFF'>'
  440. Prompt 3 Normal pstring
  441.     hnow = strip(upper(Result))
  442.     if hnow = 'M' then do
  443.             Call Markfile;return;end
  444.     if hnow = 'C' then do
  445.             call close(disp);Call Selected(cmd);end
  446.     if hnow = 'S' then do
  447.             call close(disp);signal Start;end
  448.     if hnow = 'Q' then do
  449.             call close(disp);signal QUIT;end
  450.     if hnow = 'D' then do
  451.             call close(disp);signal Download;end
  452.     if hnow = '?' then do
  453.             call close(disp);call HELP3(FILE,LISTS);end
  454.         if hnow = 'A' then do
  455.             call close(disp);CALL PrintIndex(FILE,LISTS);end
  456.     if hnow = 'K' then do
  457.         if exists('T:MRXDL'node'.sfl') then do
  458.             Address Command 'Delete T:MRXDL'node'.sfl QUIET'
  459.             pr
  460.             pr GRN'Marked files now deleted....'OFF
  461.             numselect = 0
  462.             signal markprompt
  463.             end
  464.         else do
  465.             pr
  466.             pr GRN' You have not got any files marked yet!'OFF
  467.             signal markprompt
  468.             end
  469.         end
  470. RETURN
  471.  
  472.  
  473. MARKFILE:
  474. pr
  475. Prompt 4 Normal '['GRN||numselect||OFF']'WHI'Filenumber #? ('YEL'D'WHI')-('YEL'C'WHI')ontinue.> '
  476. Filenum = Strip(Upper(result))
  477. if Filenum = '' | Filenum = 'C' then return
  478. if Filenum = 'D' then signal Download
  479. if datatype(filenum,'NUMERIC') = 0 then do
  480. pr 'You must use a number to select files..'
  481. call delay 50
  482. signal markfile
  483. end
  484. if value(filenum) <= k then do
  485. markedfile = FL.filenum
  486.         If numselect >= Maxmarked then do
  487.         pr
  488.         pr RED' Maximum files ('maxmarked') already marked!'OFF
  489.         call delay 50
  490.         return
  491.         end
  492. /************************** new stuff to get file size ****************/
  493. tofile = CDPATH||Word(dirs.answer,1)||Word(markedfile,1)
  494.  
  495. /** disable if trouble found **/
  496. if Bytecheck = 'Y' then do
  497.             fsze = word(Statef(tofile),2)
  498.             bytesallowed = bytesallowed - fsze
  499.             If bytesallowed < 1 then do
  500.             pr
  501.             pr RED' You have exceeded your available download bytes'
  502.             call delay 50
  503.             return
  504.             end
  505.         end
  506.  
  507. filepaths = CDPATH||Word(dirs.answer,1)
  508. numselect = numselect + 1
  509.  
  510. if Bytecheck = 'Y' then pr left('   File #'numselect' marked: 'YEL||word(markedfile,1)||OFF,55)'Bytes: 'YEL||fsze||OFF
  511. else pr left('   File #'numselect' marked: 'YEL||word(markedfile,1)||OFF,55)
  512.  
  513. if ~exists('T:MRXDL'node'.sfl') Then do
  514.     call open(tempdl,'T:MRXDL'node'.sfl','W')
  515.     Call WriteLn(Tempdl,filepaths word(MarkedFile,1))
  516.     Call Close(Tempdl)
  517. end
  518. else do
  519.     Call open(Tempdl,'T:MRXDL'node'.sfl','A')
  520.     Call WriteLN(tempdl,filepaths word(MarkedFile,1))
  521.     Call Close(tempdl)
  522. end
  523.  
  524. end
  525. signal Markfile
  526.  
  527.  
  528. DOWNLOAD:
  529. if ~exists('T:MRXDL'node'.sfl') Then do
  530. pr
  531. pr ' You have no files marked for download !'
  532. call delay 100
  533. signal Start
  534. end
  535. else do
  536. pr 'If you elect to continue, your selected files will be added to'
  537. pr 'the normal BBS download list..'
  538. pr
  539. pr 'To collect your files use the 'BYEL'MegaRXDL DOWNLOAD'OFF' command in the file Menu.'
  540. pr
  541. pr 'If you wish to remain within the CD-Rom door to mark further files'
  542. pr 'for downloading before leaving, hit (A)bort now and you will be returned'
  543. pr 'to the CD-Rom selection menu.'
  544. pr
  545. Call Listfiles
  546.  
  547. DOWNLOAD1:
  548. prompt 4 Normal WHI'['YEL'return'WHI'] to continue ('YEL'L'WHI')ist ('YEL'A'WHI')bort.'OFF' >'
  549. whatnext = strip(upper(result))
  550. if whatnext = 'A' then signal start
  551. if whatnext = 'L' then signal Listfiles
  552.  
  553.  
  554. SysopLog 'Exited MCDDoor (return code 0)'
  555.  
  556. exit 0
  557.  
  558.  
  559.  
  560.  
  561. QUIT:
  562.  
  563. if exists('T:MRXDL'node'.sfl') then do
  564. pr
  565. pr YEL'Your marked files will be lost if you continue..'
  566. prompt 3 Normal WHI'('YEL'C'WHI')ontinue ('YEL'D'WHI')ownload 'OFF'>'
  567. leave = strip(upper(result))
  568. if leave = 'D' then signal download
  569. Address Command 'Delete T:MRXDL'node'.sfl QUIET'
  570. END
  571. SysopLog 'Exited MCDDoor (return code 0)'
  572.  
  573. exit 0
  574.  
  575.  
  576. /***************** Ratio enforcer on login ****/
  577. RATIO:
  578. CLS
  579. pr
  580. Pr 'It seems you have exceeded your File/Byte Ratio or your daily available'
  581. Pr 'download byte limit.. '
  582. Pr 'Further download credits can be obtained by uploading some files..'
  583. Pr
  584. Pr 'Upon validation of new uploads, files found to be rubbish uploads'
  585. pr 'will result in the removal of download credits.'
  586. pr
  587. pr 'Further info or help may be obtained by contacting the Sysop.'
  588. pr
  589. msg 'Do you still wish to browse available files ? Y/n '
  590. getchar
  591. reply = upper(result)
  592. if reply = 'N' then signal quit
  593. else return
  594.  
  595.  
  596.  
  597. /***************** List marked files *********/
  598. LISTFILES:
  599. totbyt = '0'
  600. pr
  601. pr CYA' The following files are marked for Download..'OFF
  602. pr
  603. call open(lst,'T:MRXDL'node'.sfl','R')
  604. do g=1 to numselect 
  605. markf.g = Readln(lst)
  606.  
  607. tofile = Word(markf.g,1)||Word(markf.g,2)
  608.  
  609. if ByteCheck = 'Y' then do
  610.         fsze = word(Statef(tofile),2)
  611.         pr GRN||left('    File #:'BYEL||g CYA||word(markf.g,2)||OFF,55) 'Bytes: 'BYEL||fsze||OFF
  612.         totbyt = totbyt + value(fsze)
  613.         end
  614. else do
  615.     pr GRN||left('    File #:'BYEL||g CYA||word(markf.g,2)||OFF,55)
  616.     end
  617. end
  618.  
  619. if ByteCheck = 'Y' then do
  620.     pr
  621.     pr '      Total bytes:'BCYA||totbyt||OFF
  622.     if cps ~='N/A' then timedown = Trunc((totbyt / cps) /60,2)
  623. end
  624.     else timedown = 'n/a'
  625.  
  626. if baud ~= 'LOCAL' then do
  627.     pr '      Estimated Download Time @ 'BYEL||baud||OFF' baud: 'BYEL||timedown||OFF' mins.'
  628.     pr
  629.     end
  630. else do
  631. pr ' I find it a little hard to estimate how long'
  632. pr ' you take to download a file while logged in 'BCYA||baud||OFF
  633. pr
  634. end
  635. Call close(lst)
  636. signal Download1
  637.  
  638. /***************** Display time remaining ****/
  639. showtime:
  640. mins=(tmrem-TIME('E'))%60
  641. secs=TRUNC((tmrem-TIME('E'))//60)
  642. IF secs<10 THEN secs='0'secs
  643. RETURN RED'Time left: 'GRN||mins':'secs
  644.  
  645. /***************** Timer check ***************/
  646. SEIKO:
  647. test=TIME('E')
  648.   IF test>(tmrem-240) then do
  649.       If test>(tmrem-120) then do
  650.           pr;pr  BYEL'*** This session''s time is expiring! ***'OFF
  651.         Call delay 100
  652.     Call QUIT 
  653.         End
  654.       Else pr BYEL'*** Less than 2 minutes remaining in door! ***'OFF
  655. call delay 100
  656. End
  657. Return
  658.  
  659. /*************** HELP1 from Main prompt **********/
  660. HELP1:
  661.  
  662. pr
  663. pr 'This program uses MARK BY NUMBER.. If you want to mark files, hit M'
  664. pr 'to enable the Mark Prompt, then enter the number of the file you want'
  665. pr
  666. pr 'Enter the 'BYEL'number'OFF' displayed in front of the volume you wish'
  667. pr 'to access to move you into the main directories of that volume.'
  668. pr
  669. pr 'If you enter a number of a volume that is 'BYEL'not displayed'OFF' on the menu'
  670. pr 'you will be told that you do not have view access to that volume, or'
  671. pr 'if there is not a volume configured for the entered number, you will'
  672. pr 'be presented with the main prompt again.'
  673. pr 'The number in front of the actual prompt eg. ['GRN'0'OFF'] is the number of'
  674. pr 'files you have presently marked for download.'
  675. pr
  676. pr 'NEW COMMANDS:'
  677. pr ' R is used to make a request for a file on an offline CD'
  678. pr 'The prompts will ask the questions, then if the CD containing the file you'
  679. pr 'want has been loaded before your next call, you will be told the file is'
  680. pr 'ready and you may then download it..'
  681. pr ' S is used to do a search for a particular file on a CD.. It is a basic'
  682. pr 'search function that does the job, but is no super speed command,'
  683. pr 'especially searching 3000+ files in an Arexx program.. Try it out..'
  684. pr
  685. msg WHI'Hit any key to continue.'OFF
  686. Getchar
  687. pr
  688. pr
  689. pr BYEL'? 'OFF'or 'BYEL'HELP'OFF' from most prompts will give you help for the section of the'
  690. pr 'CD-Rom doorway you are in at that prompt.'
  691. pr
  692. pr BYEL'Q 'OFF'or 'BYEL'Quit'OFF' will exit from the door without saving your selected'
  693. pr 'files for download.'
  694. pr
  695. pr BYEL'K 'OFF' ill all files presently marked so you can mark a different selection.'
  696. pr
  697. msg WHI'Hit any key to continue.'OFF
  698. Getchar
  699. Signal Start
  700.  
  701. /*************** Help2 for Seldir Prompt *********/
  702. HELP2:
  703. pr
  704. pr 'This program uses MARK BY NUMBER.. If you want to mark files, hit M'
  705. pr 'to enable the Mark Prompt, then enter the number of the file you want'
  706. pr
  707. pr 'Enter the 'BYEL'number'OFF' displayed in front of the directory you wish'
  708. pr 'to view contents.'
  709. pr
  710. pr 'If you enter a number of a directory that is 'BYEL'not displayed'OFF
  711. pr 'you will be told no such directory exists and you will be presented'
  712. pr 'with the prompt again.  You cannot enter a directory that has not'
  713. pr 'scrolled onto the screen since loading the actual filelist...'
  714. pr
  715. pr 'The number in front of the actual prompt eg. ['GRN'0'OFF'] is the number of'
  716. pr 'files you have presently marked for download.'
  717. pr
  718. msg WHI'Hit any key to continue.'OFF
  719. Getchar
  720. pr
  721. pr
  722. pr BYEL'D'WHI' ownload'OFF' will commence the download procedure and place you'
  723. pr 'back at the menu you started MegaCD from, where you can use the'
  724. pr 'normal system Download command to recieve your marked files..'
  725. pr
  726. pr BYEL'C'WHI' d'OFF' will put back at the main screen for you to select a'
  727. pr 'different CD-Rom volume.'
  728. pr
  729. pr BYEL'A'WHI' gain'OFF' will redisplay the list of directories available.'
  730. pr
  731. pr BYEL'? 'OFF'or 'BYEL'HELP'OFF' from most prompts will give you help for the section of the'
  732. pr 'CD-Rom doorway you are in at that prompt.'
  733. pr
  734. pr BYEL'Q 'OFF'or 'BYEL'Quit'OFF' will exit from the door without saving your selected'
  735. pr 'files for download.'
  736. pr
  737. msg WHI'Hit any key to continue.'OFF
  738. Getchar
  739. call Selected(cmd)
  740.  
  741. /*************** Help3 for MarkPrompt Prompt *********/
  742. HELP3:
  743. parse arg FILE,LISTS
  744. pr
  745. pr 'This program uses MARK BY NUMBER.. If you want to mark files, hit M'
  746. pr 'to enable the Mark Prompt, then enter the number of the file you want'
  747. pr
  748. pr BYEL'M'WHI' ark'OFF' files for download..  You may mark up to 'MAXMARKED' files'
  749. pr 'before you are told maximum reached, then you will have to'
  750. pr 'download all marked files, before you select any more.'
  751. pr
  752. pr 'If you enter a number of a file that is 'BYEL'not displayed'OFF
  753. pr 'or has not come into view since the list was loaded, you will be'
  754. pr 'presented with the prompt again.'
  755. pr
  756. pr BYEL'S'WHI' elect'OFF' will put you back to select a different volume.'
  757. pr
  758. pr 'The number in front of the actual prompt while marking files eg.'
  759. pr '['GRN'0'OFF'] is the number of files you have presently marked.'
  760. pr
  761. msg WHI'Hit any key to continue.'OFF
  762. Getchar
  763. pr
  764. pr
  765. pr BYEL'C'WHI' d'OFF' will put back at the main screen for you to select a'
  766. pr 'different directory in the current CD-Rom volume.'
  767. pr
  768. pr BYEL'A'WHI' gain'OFF' will redisplay the list of files in the current directory.'
  769. pr
  770. pr BYEL'? 'OFF'or 'BYEL'HELP'OFF' from any prompt will give you help for the section of the'
  771. pr 'CD-Rom doorway you are in at that prompt.'
  772. pr
  773. pr BYEL'Q 'OFF'or 'BYEL'Quit'OFF' will exit from the door without saving your selected'
  774. pr 'files for download.'
  775. pr
  776. msg WHI'Hit any key to continue.'OFF
  777. Getchar
  778. pr
  779. Call PrintIndex(FILE,LISTS)
  780.  
  781.  
  782. /*************** ERROR Routine *******************/
  783. error:
  784. a = SIGL;message 'Error!!!  Line # 'a;call delay 200
  785. SysopLog 'ERROR MegaCD line # 'a
  786.  
  787.  
  788. EXIT 10
  789.  
  790. syntax:
  791. a = SIGL;message 'Syntax Error!!!  Line # 'a;call delay 200
  792. SysopLog 'SYNTAX ERROR MegaCD line # 'a
  793. EXIT 10
  794.  
  795. ioerr:
  796. message 'I/O Error!!!';call delay 200
  797. SysopLog 'IO ERROR MegaCD.'
  798.  
  799. EXIT 10
  800.